package com.marry.mybatis;

import java.lang.reflect.Proxy;

/**
 * @author ml
 * @create 2017-11-07--15:21
 */
public class MyDefaultSqlSession implements MySqlSession {

    private MyExecutor executor=new MyExecutorImpl();
    @Override
    public <T> T selectOne(String var1) {
        return executor.query(var1);
    }

    @Override
    public <T> T getMapper(Class<T> interfaces) {
        return (T) Proxy.newProxyInstance(interfaces.getClassLoader(),new Class[]{interfaces},new MyMapperProxy(this));
    }
}
